package com.unitd.frame.comm.exception;

/**
 * @desc 自定义的Web前端异常类, 主要用于定义、抛出属于Web前端出现的异常
 * @filename WebException.java
 * @copyright www.unitd.com
 * @author Hudan
 * @version 1.0
 * @date 2017/3/31
 */

public class WebException extends UnitdBaseException {

	/** 异常消息代码 */
	private String code;
	/** 异常消息说明 */
	private String desc;

	public WebException() {
	}

	public WebException(String message) {
		super(message);
		this.desc = message;
	}

	public WebException(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public WebException(String code, String desc, Throwable cause) {
		super(cause);
		this.code = code;
		this.desc = desc;
	}

	public WebException(String code, String desc, String message) {
		super(message);
		this.code = code;
		this.desc = desc;
	}

	public String getCode() {
		return this.code;
	}

	public String getDesc() {
		return this.desc;
	}

	@Override
	public String getMessage() {
		return super.getMessage() == null ? this.desc : super.getMessage();
	}
}